\documentclass[12pt]{article}
\usepackage{calc,fancyhdr}
\usepackage[hmargin=.5in,vmargin=.75in,
            footskip=.25in,headsep=.5in-\headheight]{geometry}

% Template solution to Exercise 3.

% Common formatting macros for CSC165.
\usepackage{amsmath,amssymb}
\input{macros-165}

% Page layout: stretch text to fill up page.
\flushbottom

% Headings.
\pagestyle{fancy}
\let\headrule\empty
\let\footrule\empty
\lhead{CSC\,165\,H1S}
\chead{Homework Exercise \#\,3}
\rhead{Winter 2014}

\begin{document}

\begin{large}
  \noindent
  Partner (1): Andrea Hunter \hfill CDF login name: c3hunter\\[0.5cm]
  Partner (A): David Keon    \hfill CDF login name: c3keonda
\end{large}

\medskip

\noindent
\rule{\textwidth}{.5pt}

\subsection*{Topic: analyzing logical statements}

\medskip

\begin{enumerate}
 
       
    % place solution to question 1 below

    \item
    The statements that you are considering are:
    $$\exists\, x \in D,\, (P(x) \land Q(x))$$
    and
    $$(\exists\, x \in D,\, P(x)) \land (\exists\, x \in D,\, Q(x))$$

    Note that \verb|$| is used to start and end math expressions that
    appear in-line with other text, while \verb|$$| is used to start and
    end math expressions that are centered and ``displayed'' separately.
    The symbol \verb|$$| is a short-form for using the displaymath 
    environment.
    Domain D = {people living on an island}
    Predicate P operates on people's status and is defined by P(x): "person 
    x is a treasure guard.
    Predicate Q operates on people's status and is defined by Q(x): "person 
    x is a treasure hunter.
    $$ 
      \begin{array}{|c|c|}
        Person & Status \\
        \hline
        \ Alex  & \ guard \\ 
        \ Barrie  & \ guard \\ 
        \ Diane & \ hunter \\ 
        \ Fiona & \ hunter \\ 
      \end{array} 
     $$
    
    % place solution to question 2 below

    \item 
    Here are the math expressions used in the statement of the problem:
    $$ 
      \begin{array}{l}
        \displaystyle{\lim_{x\rightarrow a} f(x) = L} \\[0.25cm]
        \forall\, \epsilon \in \R^{+},\, \exists\ \delta \in \R^{+},\,
          \forall\ x \in \R,\, 
            0 < | x-a | < \delta \implies | f(x) - L | < \epsilon. \\[0.25cm]
        \displaystyle{\lim_{x\rightarrow a} f(x) \ne L}
       \end{array}
    $$

    % place solution to question 3 below

    \item 
    Here is a sample truth table:
    $$ 
      \begin{array}{cc||c}
        A & B & A \land B \\
        \hline
        \True & \True & \True \\
        \True & \False & \False \\
        \False & \True & \False \\
        \False & \False & \False 
      \end{array} 
    $$

    It is easy to add more columns:
    $$ 
      \begin{array}{cc||c|c|c|c|c}
        A      & B      & A \land B & A \lor B & A \implies B & \lnot A & \lnot A \lor B\\
        \hline
        \True  & \True  & \True     & \True    & \True        & \False  & \True \\
        \True  & \False & \False    & \True    & \False       & \False  & \False \\
        \False & \True  & \False    & \True    & \True        & \True   & \True \\
        \False & \False & \False    & \False   & \True        & \True   & \True
      \end{array} 
    $$


    % place solution to question 4 below

    \item
    \begin{enumerate}
      \item $\forall x \in D, S(x) \Rightarrow \neg C(x)$
      \item $ S(w)\Rightarrow C(w) \bigwedge S(c)\Rightarrow C(c) $
      \item $\forall x \in D, ( S(x)\Rightarrow M(x) ) \Rightarrow C(x)$
      \item $\exists x\in D, S(x) \Rightarrow (M(x)\bigwedge C(x))$
      \item $\exists x\in D, S(x) \Rightarrow M(x)\bigwedge \exists x\in D, S(x) \Rightarrow M(x)$
      \item $\exists x\in D,( S(x) \Rightarrow M(x))\Rightarrow M(x)$
      \item $(\forall x \in D, S(x)\bigwedge \forall y \in D, I(y), L(x,y)) \Rightarrow \exists x \in D,L(x,x) $
    \end{enumerate}
\end{enumerate}

\medskip

\noindent
\rule{\textwidth}{.5pt}

\end{document}
